<!DOCTYPE html>
<html>
<head>
 <meta charset="UTF-8">   
<title>管理员登陆</title>
<?php

include_once('admin/DB.php');
$DB =  new DB();
//如果点击了提交
if(isset($_POST['submit'])){
    $username = $_POST['username'];
    $password = $_POST['password'];
    
    //进行验证用户名，密码的操作
    $res_list = $DB->get_all("select * from user");
    //如果用户名存在 验证密码
    foreach ($res_list as $value){
        if($value['username']==$username&&$value['password']==$password){
             echo "<script>location='admin/manager.php';</Script>";
        }
    }
     echo  "<script>alert('用户名，密码不正确，请重新登陆');</Script>";
     
}
?>
</head>
<body>
<form action="" method="post">
    用户名：<input type="text" name="username"></br>
    密码:<input type="password" name="password"></br>
    <input type="submit" name="submit" value="提交">
</form>
</body>
</html>